<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <style>
        /*进入过度的初始状态*/
        .fade1-enter{
            opacity: 0;
            transform: translateX(400px);
        }
        /*整个 进入过渡的 过程*/
        .fade1-enter-active{
            transition: all 2s;
        }
        /*进入过度结束状态*/
        .fade1-enter-to{
            background-color: red;
        }
        /*离开过度的初始状态*/
        .fade1-leave{
            /*border: 1px solid blue;*/
        }
        /*整个离开过度的过程*/
        .fade1-leave-active{
            transition: all 2s;
        }
        /*离开过度的结束状态*/
        .fade1-leave-to{
            opacity: 0;
            transform: translateX(400px);
            background-color: yellow;
        }


        .fade2-enter{
            transform: translateY(200px);
            opacity: 0;
        }
        .fade2-enter-active{
            transition: all 3s;
        }
        .fade2-enter-to{
            background-color: blue;
        }
        .fade2-leave{
            opacity: 1;
            transform: translateY(0px);
        }
        .fade2-leave-active{
            transition: all 5s;
        }
        .fade2-leave-to{
            transform: translateY(300px);
            opacity: 0;
            background-color: green;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="isShow=!isShow">按钮</button>
    <transition name="fade1">
        <p v-if="isShow===true">HELLO WORLD</p>
    </transition>
    <transition name="fade2">
        <p v-if="isShow===true">HELLO WORLD</p>
    </transition>
</div>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            isShow:true
        },
        methods:{}
    })
</script>
</body>
</html>
